package router

import (
	"github.com/gin-gonic/gin"
	"sgo/app/system/controller"
	"sgo/scontext"
	"sgo/wrapper"
)

type System struct{}

func (System) use(sc *scontext.SgoContext, r *gin.RouterGroup) {
	ug := r.Group("/user")
	{
		userController := controller.UserController{}
		ug.GET("/list", wrapper.HandlerFunc(sc, userController.List))
		ug.GET("/delete/:id", wrapper.HandlerFunc(sc, userController.Delete))
		ug.POST("/create", wrapper.HandlerFunc(sc, userController.Create))
		ug.POST("/update", wrapper.HandlerFunc(sc, userController.Update))
		ug.POST("/createAndDelete", wrapper.HandlerFunc(sc, userController.CreateAndDelete))
	}
}
